package com.sixkey.aspect;

/**
 * ClassName: EventPublistener
 * Package: com.sixkey.aspect
 * Description:
 *
 * @Author: @weixueshi
 * @Create: 2023/9/10 - 0:18
 * @Version: v1.0
 */

import com.sixkey.entity.Log;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * 事件发布监听器：用于监听用户操作日志记录
 */
@Slf4j
@Component
public class EventPublistener {

    @Autowired
    private ApplicationContext applicationContext;

    /**
     * 发布事件
     */
    public void publishEvent(Log operLog){
        log.info("用户操作日志记录发布事件---------");
        applicationContext.publishEvent(operLog);
    }
}
